package pl.un4giv3n.mightvsmagic.action.clan;

import javax.persistence.EntityManager;

public class ShowBudgetPageAction extends ClanAction{

	private static final long serialVersionUID = 1L;

	@Override
	public String execute() {
		EntityManager entityManager = getEntityManager();
		user = getSessionUser(entityManager);
		if (user == null) {
			addActionError("Zaloguj się");
			entityManager.close();
			return LOGIN;
		}
		if(user.getClan() == null){
			entityManager.close();
			addActionError("Nie jesteś członkiem klanu");
			return ERROR;
		}else{
			clan = user.getClan();
		}
		entityManager.close();
		return SUCCESS;
	}
}
